package cn.hyy.client;

import cn.hyy.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserClentFalibackFactory implements FallbackFactory<UserClient>{

    @Override
    public UserClient create(Throwable throwable) {
        return new UserClient() {
            @Override
            public User getById(Long id) {
                return new User(0L,"系统异常","系统异常");
            }
        };
    }
}
